package com.quad.innovators.salesease.service.warehouse;

import com.baomidou.mybatisplus.extension.service.IService;
import com.quad.innovators.salesease.model.entity.warehouse.PurchaseOrderDetail;
import com.quad.innovators.salesease.model.form.warehouse.PurchaseOrderDetailForm;

import java.util.List;

/**
 * @author : shanshan.li
 * @createTime : 2024/10/21 21:38
 * @Version : 1.0 
 */
public interface PurchaseOrderDetailService extends IService<PurchaseOrderDetail> {
    /**
     * 新增采购单详情
     * @param purchaseOrderCode 采购单code
     * @param purchaseOrderDetailFormList 新增列表
     * @return 返回新增结果
     */
    boolean saveList(String purchaseOrderCode, List<PurchaseOrderDetailForm> purchaseOrderDetailFormList);

    /**
     * 修改采购单 - 删除之前和采购单关联的详情, 重新新增采购单
     * @param purchaseOrderCode 采购单code
     * @param purchaseOrderDetailFormList 修改详情列表
     * @return 返回修改结果
     */
    boolean updateList(String purchaseOrderCode, List<PurchaseOrderDetailForm> purchaseOrderDetailFormList);

    /**
     * 根据采购单code获取详情列表
     * @param purchaseOrderCode 采购单code
     * @return 采购单详情列表
     */
    List<PurchaseOrderDetailForm> getListByPurchaseOrderCode(String purchaseOrderCode);

    /**
     * 修改采购单产品下单请款
     * @param code 采购单产品code
     * @return 返回是否成功
     */
    boolean updateStatus(String code);
}
